package com.huilian.iotbox.data.enums;

import lombok.Getter;

/**
 * 活动类型
 *
 * @Author mineChen
 * @Date 2020/5/20 15:56
 */
@Getter
public enum ActivityTypeEnum {
    SECKILL(1, "秒杀"),
    GROUP_BOOKING(2, "拼团"),
    CONSUMPTION_OF_RED_ENVELOPES(3, "消费红包"),
    MEMBER_OF_THE_STORED_VALUE(4, "会员储值"),
    VOUCHER_FETCH_COIN(5, "取币凭证"),
    DOUYIN_GROUP_BUY(6, "抖音团购"),
    ;

    private final Integer code;
    private final String desc;

    ActivityTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static String formatDesc(Integer code){
        ActivityTypeEnum[] values = ActivityTypeEnum.values();
        String desc = null;
        for (int i = 0; i < values.length; i++) {
            if (values[i].code.compareTo(code) == 0){
                desc = values[i].desc;
                break;
            }
        }
        return desc;
    }
}
